<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        var a=20;
        var b=30;
        var num="*";
        switch(num){
            case "+":
            console.log(a+b);
            break;
            case "-":
            console.log(a-b);
            break;
            case "*":
            console.log(a*b);
            break;
            default:
            console.log(a/b);
            break;
        }   
    </script>
</body>
</html>